<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">
<f:view>
	<h:head>
	</h:head>
	<h:body>
		<h:form id="form">
<h:panelGroup id="poll">
			<a4j:poll enabled="#{commandBean.pollEnabled}" interval="5000" ontimer="return confirm('execute action?')">
			<a4j:ajax event="timer" render="time" />
			</a4j:poll>
			</h:panelGroup>
			<a4j:commandButton actionListener="#{commandBean.enablePoll}" value="Start polling"  render="poll" />
			<a4j:commandButton actionListener="#{commandBean.disablePoll}" value="Stop polling"  render="poll" />
		</h:form>
		<h:panelGroup id="time">
	<h:outputText value="#{commandBean.date}"/>
	</h:panelGroup>
	</h:body>
</f:view>
</html>